﻿using System;
using System.Collections.Generic;
using viPage.Classes;
using viPage.Controllers;
using visinia.SmartEngine;
using visinia.SmartEngine.Installer;
using visinia.SmartEngine.SiteMap;

namespace viPage.HttpHandlers
{
    public class SiteMap : BaseSiteMap
    {
        public override List<SiteMapInfo> GenerateSiteMap()
        {
            List<SiteMapInfo> list = new List<SiteMapInfo>();
            viPageController.GetPages().ForEach(delegate(viPageInfo page)
            {
                string url = WebRoots.GetWebRoot + PluginController.GetInstalledPlugin("viPage").UrlSeparator + "/" + page.Name + ".aspx";
                list.Add(new SiteMapInfo("viPage", page.Title, url, DateTime.Now, SiteMapInfo.ChangeFreq.Monthly));
            });
            return list;
        }
    }
}
